package com.tangsm.spring.boot.degradation.service.impl;

import com.tangsm.spring.boot.degradation.annotation.ResourceDegradation;
import com.tangsm.spring.boot.degradation.service.HelloService;
import org.springframework.stereotype.Service;

@Service("helloService")
public class HelloServiceImpl implements HelloService {

    @Override
    @ResourceDegradation(fallbackClass = HelloFallBackServiceImpl.class, resourceId = "hello")
    public String hello(String userName) {
        try {
            //模拟业务请求
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
        }
        return "hello:" + userName;
    }
}
